package cn.gcjxsc.common.consts;

/**
 * 红包记录查询角色
 * @author pumbaa
 * @since 1.0
 */
public enum RedPackRecordRole {
    MEMBER(1), MERCHANT(2);
    private int type;

    RedPackRecordRole(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public static RedPackRecordRole fromCode(int role) {
        RedPackRecordRole[] values = RedPackRecordRole.values();
        for (RedPackRecordRole value : values) {
            if (value.getType() == role) {
                return value;
            }
        }
        return null;
    }
}
